//
//  KATTextStyle.m
//  KATFramework
//
//  Created by Kantice on 16/1/26.
//  Copyright © 2016年 KatApp. All rights reserved.
//

#import "KATTextStyle.h"
#import "KATMacros.h"


@implementation KATTextStyle



//获取实例
+ (instancetype)textStyle
{
    return [[[KATTextStyle alloc] init] autorelease];
}


//初始化
- (instancetype)init
{
    self=[super init];
    
    self.exclusions=nil;
    self.marginTop=0.0f;
    self.marginBottom=0.0f;
    self.marginLeft=0.0f;
    self.marginRight=0.0f;
    
    self.bgColor=[UIColor clearColor];
    self.textFont=FONT_CALLOUT;
    self.textColor=KCOLOR_DARK;
    self.textBgColor=[UIColor clearColor];
    self.textAlignment=NSTextAlignmentLeft;
    self.textLineBreak=NSLineBreakByWordWrapping|NSLineBreakByTruncatingTail;
    self.editable=YES;
    self.selectable=YES;
    self.scrollable=YES;
    self.lines=0;
    self.paragraph=nil;
    
    self.hasUrlStyle=YES;
    self.urlFont=self.textFont;
    self.urlTextColor=KCOLOR_BLUE;
    self.urlBgColor=[UIColor clearColor];
    self.urlLineColor=KCOLOR_BLUE;
    self.urlUnderLine=NSUnderlineStyleSingle;
    self.urlDeleteLine=NSUnderlineStyleNone;
    
    self.hasPhoneStyle=NO;
    self.phoneFont=self.textFont;
    self.phoneTextColor=KCOLOR_BLUE;
    self.phoneBgColor=[UIColor clearColor];
    self.phoneLineColor=KCOLOR_BLUE;
    self.phoneUnderLine=NSUnderlineStyleSingle;
    self.phoneDeleteLine=NSUnderlineStyleNone;
    
    self.hasDateStyle=NO;
    self.dateFont=self.textFont;
    self.dateTextColor=KCOLOR_BLUE;
    self.dateBgColor=[UIColor clearColor];
    self.dateLineColor=[UIColor clearColor];
    self.dateUnderLine=NSUnderlineStyleNone;
    self.dateDeleteLine=NSUnderlineStyleNone;
    
    self.hasTimeStyle=YES;
    self.timeFont=self.textFont;
    self.timeTextColor=KCOLOR_BLUE;
    self.timeBgColor=[UIColor clearColor];
    self.timeLineColor=[UIColor clearColor];
    self.timeUnderLine=NSUnderlineStyleNone;
    self.timeDeleteLine=NSUnderlineStyleNone;
    
    self.hasRangeStyle=NO;
    self.rangeStartSymbol=nil;
    self.rangeEndSymbol=nil;
    self.rangeFont=self.textFont;
    self.rangeTextColor=KCOLOR_ORANGE;
    self.rangeBgColor=[UIColor clearColor];
    self.rangeLineColor=self.rangeTextColor;
    self.rangeUnderLine=NSUnderlineStyleNone;
    self.rangeDeleteLine=NSUnderlineStyleNone;
    
    self.hasRange2Style=NO;
    self.range2StartSymbol=nil;
    self.range2EndSymbol=nil;
    self.range2Font=self.textFont;
    self.range2TextColor=KCOLOR_ORANGE;
    self.range2BgColor=[UIColor clearColor];
    self.range2LineColor=self.range2TextColor;
    self.range2UnderLine=NSUnderlineStyleNone;
    self.range2DeleteLine=NSUnderlineStyleNone;
    
    self.hasRange3Style=NO;
    self.range3StartSymbol=nil;
    self.range3EndSymbol=nil;
    self.range3Font=self.textFont;
    self.range3TextColor=KCOLOR_ORANGE;
    self.range3BgColor=[UIColor clearColor];
    self.range3LineColor=self.range3TextColor;
    self.range3UnderLine=NSUnderlineStyleNone;
    self.range3DeleteLine=NSUnderlineStyleNone;
    
    self.hasExpStyle=NO;
    self.expression=nil;
    self.expFont=self.textFont;
    self.expTextColor=KCOLOR_CYAN;
    self.expBgColor=[UIColor clearColor];
    self.expLineColor=self.expTextColor;
    self.expUnderLine=NSUnderlineStyleNone;
    self.expDeleteLine=NSUnderlineStyleNone;
    
    self.hasExp2Style=NO;
    self.expression2=nil;
    self.exp2Font=self.textFont;
    self.exp2TextColor=KCOLOR_CYAN;
    self.exp2BgColor=[UIColor clearColor];
    self.exp2LineColor=self.exp2TextColor;
    self.exp2UnderLine=NSUnderlineStyleNone;
    self.exp2DeleteLine=NSUnderlineStyleNone;
    
    self.hasExp3Style=NO;
    self.expression3=nil;
    self.exp3Font=self.textFont;
    self.exp3TextColor=KCOLOR_CYAN;
    self.exp3BgColor=[UIColor clearColor];
    self.exp3LineColor=self.exp3TextColor;
    self.exp3UnderLine=NSUnderlineStyleNone;
    self.exp3DeleteLine=NSUnderlineStyleNone;
    
    self.hasKeywordsStyle=NO;
    self.keywords=nil;
    self.keywordsFont=self.textFont;
    self.keywordsTextColor=KCOLOR_RED;
    self.keywordsBgColor=[UIColor clearColor];
    self.keywordsLineColor=self.keywordsTextColor;
    self.keywordsUnderLine=NSUnderlineStyleNone;
    self.keywordsDeleteLine=NSUnderlineStyleNone;
    
    self.hasKeywords2Style=NO;
    self.keywords2=nil;
    self.keywords2Font=self.textFont;
    self.keywords2TextColor=KCOLOR_RED;
    self.keywords2BgColor=[UIColor clearColor];
    self.keywords2LineColor=self.keywords2TextColor;
    self.keywords2UnderLine=NSUnderlineStyleNone;
    self.keywords2DeleteLine=NSUnderlineStyleNone;
    
    self.hasKeywords3Style=NO;
    self.keywords3=nil;
    self.keywords3Font=self.textFont;
    self.keywords3TextColor=KCOLOR_RED;
    self.keywords3BgColor=[UIColor clearColor];
    self.keywords3LineColor=self.keywords3TextColor;
    self.keywords3UnderLine=NSUnderlineStyleNone;
    self.keywords3DeleteLine=NSUnderlineStyleNone;
    
    self.hasKeywords4Style=NO;
    self.keywords4=nil;
    self.keywords4Font=self.textFont;
    self.keywords4TextColor=KCOLOR_RED;
    self.keywords4BgColor=[UIColor clearColor];
    self.keywords4LineColor=self.keywords4TextColor;
    self.keywords4UnderLine=NSUnderlineStyleNone;
    self.keywords4DeleteLine=NSUnderlineStyleNone;
    
    self.hasKeywords5Style=NO;
    self.keywords5=nil;
    self.keywords5Font=self.textFont;
    self.keywords5TextColor=KCOLOR_RED;
    self.keywords5BgColor=[UIColor clearColor];
    self.keywords5LineColor=self.keywords5TextColor;
    self.keywords5UnderLine=NSUnderlineStyleNone;
    self.keywords5DeleteLine=NSUnderlineStyleNone;
    
    self.hasKeywords6Style=NO;
    self.keywords6=nil;
    self.keywords6Font=self.textFont;
    self.keywords6TextColor=KCOLOR_RED;
    self.keywords6BgColor=[UIColor clearColor];
    self.keywords6LineColor=self.keywords6TextColor;
    self.keywords6UnderLine=NSUnderlineStyleNone;
    self.keywords6DeleteLine=NSUnderlineStyleNone;
    
    self.hasKeywords7Style=NO;
    self.keywords7=nil;
    self.keywords7Font=self.textFont;
    self.keywords7TextColor=KCOLOR_RED;
    self.keywords7BgColor=[UIColor clearColor];
    self.keywords7LineColor=self.keywords7TextColor;
    self.keywords7UnderLine=NSUnderlineStyleNone;
    self.keywords7DeleteLine=NSUnderlineStyleNone;
    
    self.hasKeywords8Style=NO;
    self.keywords8=nil;
    self.keywords8Font=self.textFont;
    self.keywords8TextColor=KCOLOR_RED;
    self.keywords8BgColor=[UIColor clearColor];
    self.keywords8LineColor=self.keywords8TextColor;
    self.keywords8UnderLine=NSUnderlineStyleNone;
    self.keywords8DeleteLine=NSUnderlineStyleNone;
    
    self.hasKeywords9Style=NO;
    self.keywords9=nil;
    self.keywords9Font=self.textFont;
    self.keywords9TextColor=KCOLOR_RED;
    self.keywords9BgColor=[UIColor clearColor];
    self.keywords9LineColor=self.keywords9TextColor;
    self.keywords9UnderLine=NSUnderlineStyleNone;
    self.keywords9DeleteLine=NSUnderlineStyleNone;
    
    return self;
}


//图片复制(手势会失效)
- (instancetype)copyWithZone:(NSZone *)zone
{
    KATTextStyle *style=[[[self class] allocWithZone: zone] init];
    
    style.exclusions=_exclusions;
    style.marginTop=_marginTop;
    style.marginBottom=_marginBottom;
    style.marginLeft=_marginLeft;
    style.marginRight=_marginRight;
    
    style.bgColor=_bgColor;
    style.textFont=_textFont;
    style.textColor=_textColor;
    style.textBgColor=_textBgColor;
    style.textAlignment=_textAlignment;
    style.textLineBreak=_textLineBreak;
    style.editable=_editable;
    style.selectable=_selectable;
    style.scrollable=_scrollable;
    style.lines=_lines;
    style.paragraph=_paragraph;
    
    style.hasUrlStyle=_hasUrlStyle;
    style.urlFont=_urlFont;
    style.urlTextColor=_urlTextColor;
    style.urlBgColor=_urlBgColor;
    style.urlLineColor=_urlLineColor;
    style.urlUnderLine=_urlUnderLine;
    style.urlDeleteLine=_urlDeleteLine;
    
    style.hasPhoneStyle=_hasPhoneStyle;
    style.phoneFont=_phoneFont;
    style.phoneTextColor=_phoneTextColor;
    style.phoneBgColor=_phoneBgColor;
    style.phoneLineColor=_phoneLineColor;
    style.phoneUnderLine=_phoneUnderLine;
    style.phoneDeleteLine=_phoneDeleteLine;
    
    style.hasDateStyle=_hasDateStyle;
    style.dateFont=_dateFont;
    style.dateTextColor=_dateTextColor;
    style.dateBgColor=_dateBgColor;
    style.dateLineColor=_dateLineColor;
    style.dateUnderLine=_dateUnderLine;
    style.dateDeleteLine=_dateDeleteLine;
    
    style.hasTimeStyle=_hasTimeStyle;
    style.timeFont=_timeFont;
    style.timeTextColor=_timeTextColor;
    style.timeBgColor=_timeBgColor;
    style.timeLineColor=_timeLineColor;
    style.timeUnderLine=_timeUnderLine;
    style.timeDeleteLine=_timeDeleteLine;
    
    style.hasRangeStyle=_hasRangeStyle;
    style.rangeStartSymbol=_rangeStartSymbol;
    style.rangeEndSymbol=_rangeEndSymbol;
    style.rangeFont=_rangeFont;
    style.rangeTextColor=_rangeTextColor;
    style.rangeBgColor=_rangeBgColor;
    style.rangeLineColor=_rangeLineColor;
    style.rangeUnderLine=_rangeUnderLine;
    style.rangeDeleteLine=_rangeDeleteLine;
    
    style.hasRange2Style=_hasRange2Style;
    style.range2StartSymbol=_range2StartSymbol;
    style.range2EndSymbol=_range2EndSymbol;
    style.range2Font=_range2Font;
    style.range2TextColor=_range2TextColor;
    style.range2BgColor=_range2BgColor;
    style.range2LineColor=_range2LineColor;
    style.range2UnderLine=_range2UnderLine;
    style.range2DeleteLine=_range2DeleteLine;
    
    style.hasRange3Style=_hasRange3Style;
    style.range3StartSymbol=_range3StartSymbol;
    style.range3EndSymbol=_range3EndSymbol;
    style.range3Font=_range3Font;
    style.range3TextColor=_range3TextColor;
    style.range3BgColor=_range3BgColor;
    style.range3LineColor=_range3LineColor;
    style.range3UnderLine=_range3UnderLine;
    style.range3DeleteLine=_range3DeleteLine;
    
    style.hasExpStyle=_hasExpStyle;
    style.expression=_expression;
    style.expFont=_expFont;
    style.expTextColor=_expTextColor;
    style.expBgColor=_expBgColor;
    style.expLineColor=_expLineColor;
    style.expUnderLine=_expUnderLine;
    style.expDeleteLine=_expDeleteLine;
    
    style.hasExp2Style=_hasExp2Style;
    style.expression2=_expression2;
    style.exp2Font=_exp2Font;
    style.exp2TextColor=_exp2TextColor;
    style.exp2BgColor=_exp2BgColor;
    style.exp2LineColor=_exp2LineColor;
    style.exp2UnderLine=_exp2UnderLine;
    style.exp2DeleteLine=_exp2DeleteLine;
    
    style.hasExp3Style=_hasExp3Style;
    style.expression3=_expression3;
    style.exp3Font=_exp3Font;
    style.exp3TextColor=_exp3TextColor;
    style.exp3BgColor=_exp3BgColor;
    style.exp3LineColor=_exp3LineColor;
    style.exp3UnderLine=_exp3UnderLine;
    style.exp3DeleteLine=_exp3DeleteLine;
    
    style.hasKeywordsStyle=_hasKeywordsStyle;
    style.keywords=_keywords;
    style.keywordsFont=_keywordsFont;
    style.keywordsTextColor=_keywordsTextColor;
    style.keywordsBgColor=_keywordsBgColor;
    style.keywordsLineColor=_keywordsLineColor;
    style.keywordsUnderLine=_keywordsUnderLine;
    style.keywordsDeleteLine=_keywordsDeleteLine;
    
    style.hasKeywords2Style=_hasKeywords2Style;
    style.keywords2=_keywords2;
    style.keywords2Font=_keywords2Font;
    style.keywords2TextColor=_keywords2TextColor;
    style.keywords2BgColor=_keywords2BgColor;
    style.keywords2LineColor=_keywords2LineColor;
    style.keywords2UnderLine=_keywords2UnderLine;
    style.keywords2DeleteLine=_keywords2DeleteLine;
    
    style.hasKeywords3Style=_hasKeywords3Style;
    style.keywords3=_keywords3;
    style.keywords3Font=_keywords3Font;
    style.keywords3TextColor=_keywords3TextColor;
    style.keywords3BgColor=_keywords3BgColor;
    style.keywords3LineColor=_keywords3LineColor;
    style.keywords3UnderLine=_keywords3UnderLine;
    style.keywords3DeleteLine=_keywords3DeleteLine;
    
    style.hasKeywords4Style=_hasKeywords4Style;
    style.keywords4=_keywords4;
    style.keywords4Font=_keywords4Font;
    style.keywords4TextColor=_keywords4TextColor;
    style.keywords4BgColor=_keywords4BgColor;
    style.keywords4LineColor=_keywords4LineColor;
    style.keywords4UnderLine=_keywords4UnderLine;
    style.keywords4DeleteLine=_keywords4DeleteLine;
    
    style.hasKeywords5Style=_hasKeywords5Style;
    style.keywords5=_keywords5;
    style.keywords5Font=_keywords5Font;
    style.keywords5TextColor=_keywords5TextColor;
    style.keywords5BgColor=_keywords5BgColor;
    style.keywords5LineColor=_keywords5LineColor;
    style.keywords5UnderLine=_keywords5UnderLine;
    style.keywords5DeleteLine=_keywords5DeleteLine;
    
    style.hasKeywords6Style=_hasKeywords6Style;
    style.keywords6=_keywords6;
    style.keywords6Font=_keywords6Font;
    style.keywords6TextColor=_keywords6TextColor;
    style.keywords6BgColor=_keywords6BgColor;
    style.keywords6LineColor=_keywords6LineColor;
    style.keywords6UnderLine=_keywords6UnderLine;
    style.keywords6DeleteLine=_keywords6DeleteLine;
    
    style.hasKeywords7Style=_hasKeywords7Style;
    style.keywords7=_keywords7;
    style.keywords7Font=_keywords7Font;
    style.keywords7TextColor=_keywords7TextColor;
    style.keywords7BgColor=_keywords7BgColor;
    style.keywords7LineColor=_keywords7LineColor;
    style.keywords7UnderLine=_keywords7UnderLine;
    style.keywords7DeleteLine=_keywords7DeleteLine;
    
    style.hasKeywords8Style=_hasKeywords8Style;
    style.keywords8=_keywords8;
    style.keywords8Font=_keywords8Font;
    style.keywords8TextColor=_keywords8TextColor;
    style.keywords8BgColor=_keywords8BgColor;
    style.keywords8LineColor=_keywords8LineColor;
    style.keywords8UnderLine=_keywords8UnderLine;
    style.keywords8DeleteLine=_keywords8DeleteLine;
    
    style.hasKeywords9Style=_hasKeywords9Style;
    style.keywords9=_keywords9;
    style.keywords9Font=_keywords9Font;
    style.keywords9TextColor=_keywords9TextColor;
    style.keywords9BgColor=_keywords9BgColor;
    style.keywords9LineColor=_keywords9LineColor;
    style.keywords9UnderLine=_keywords9UnderLine;
    style.keywords9DeleteLine=_keywords9DeleteLine;
    
    return style;
}


- (void)dealloc
{
    [_exclusions release];
    [_bgColor release];
    [_textFont release];
    [_textColor release];
    [_paragraph release];
    
    [_urlFont release];
    [_urlTextColor release];
    [_urlBgColor release];
    [_urlLineColor release];
    
    [_phoneFont release];
    [_phoneTextColor release];
    [_phoneBgColor release];
    [_phoneLineColor release];
    
    [_dateFont release];
    [_dateTextColor release];
    [_dateBgColor release];
    [_dateLineColor release];
    
    [_timeFont release];
    [_timeTextColor release];
    [_timeBgColor release];
    [_timeLineColor release];
    
    [_rangeStartSymbol release];
    [_rangeEndSymbol release];
    [_rangeFont release];
    [_rangeTextColor release];
    [_rangeBgColor release];
    [_rangeLineColor release];
    
    [_range2StartSymbol release];
    [_range2EndSymbol release];
    [_range2Font release];
    [_range2TextColor release];
    [_range2BgColor release];
    [_range2LineColor release];
    
    [_range3StartSymbol release];
    [_range3EndSymbol release];
    [_range3Font release];
    [_range3TextColor release];
    [_range3BgColor release];
    [_range3LineColor release];
    
    [_expression release];
    [_expFont release];
    [_expTextColor release];
    [_expBgColor release];
    [_expLineColor release];
    
    [_expression2 release];
    [_exp2Font release];
    [_exp2TextColor release];
    [_exp2BgColor release];
    [_exp2LineColor release];
    
    [_expression3 release];
    [_exp3Font release];
    [_exp3TextColor release];
    [_exp3BgColor release];
    [_exp3LineColor release];
    
    [_keywords release];
    [_keywordsFont release];
    [_keywordsTextColor release];
    [_keywordsBgColor release];
    [_keywordsLineColor release];
    
    [_keywords2 release];
    [_keywords2Font release];
    [_keywords2TextColor release];
    [_keywords2BgColor release];
    [_keywords2LineColor release];
    
    [_keywords3 release];
    [_keywords3Font release];
    [_keywords3TextColor release];
    [_keywords3BgColor release];
    [_keywords3LineColor release];
    
    [_keywords4 release];
    [_keywords4Font release];
    [_keywords4TextColor release];
    [_keywords4BgColor release];
    [_keywords4LineColor release];
    
    [_keywords5 release];
    [_keywords5Font release];
    [_keywords5TextColor release];
    [_keywords5BgColor release];
    [_keywords5LineColor release];
    
    [_keywords6 release];
    [_keywords6Font release];
    [_keywords6TextColor release];
    [_keywords6BgColor release];
    [_keywords6LineColor release];
    
    [_keywords7 release];
    [_keywords7Font release];
    [_keywords7TextColor release];
    [_keywords7BgColor release];
    [_keywords7LineColor release];
    
    [_keywords8 release];
    [_keywords8Font release];
    [_keywords8TextColor release];
    [_keywords8BgColor release];
    [_keywords8LineColor release];
    
    [_keywords9 release];
    [_keywords9Font release];
    [_keywords9TextColor release];
    [_keywords9BgColor release];
    [_keywords9LineColor release];
    
    
    [super dealloc];
}






@end
